class Dog:
    def __init__(self, name):
        self.name = name

    def game(self):
        print("%s 蹦蹦跳跳地玩耍" % self.name)


class Xtq(Dog):
    def game(self):
        print("%s 飞到天上去玩耍" % self.name)


class Person:
    def __init__(self, name):
        self.name = name

    def game_with_dog(self,dog:Dog): #写Dog方便xtq和dog均可输入
        print("%s 和 %s 快乐滴玩耍..." % (self.name, dog.name))
        """多态：同一代码发挥不同的作业=用"""
        dog.game()


if __name__ == '__main__':
    wangcai = Dog("wangcai")
    xtq = Xtq("xtq")
    xiaoming = Person("xiaoming")
    xiaoming.game_with_dog(wangcai)
    print('*' * 50)
    xiaoming.game_with_dog(xtq)